Skip to content

Obsolete Roots, Sampling, and Logging surface area per SEP-2577#1651

Open
tarekgh wants to merge 1 commit into
modelcontextprotocol:mainfrom
tarekgh:obsolete-roots-sampling-logging-sep2577
Open

Obsolete Roots, Sampling, and Logging surface area per SEP-2577#1651
tarekgh wants to merge 1 commit into
modelcontextprotocol:mainfrom
tarekgh:obsolete-roots-sampling-logging-sep2577

Conversation

@tarekgh

@tarekgh tarekgh commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Marks the public API surface for the Roots, Sampling, and Logging features as [Obsolete] in line with SEP-2577, which deprecates these three features in specification version 2026-07-28.

There is no functional or wire-behavior change. The features continue to work exactly as before; consumers simply get a compile-time deprecation warning guiding them away from the deprecated surface.

What is deprecated

The deprecation covers the full surface area of all three features:

  • Protocol DTOs (e.g. Root, ListRootsResult, CreateMessageRequestParams, CreateMessageResult, SamplingMessage, ModelPreferences, LoggingLevel, SetLevelRequestParams, LoggingMessageNotificationParams, and related types).
  • Capability properties (RootsCapability, SamplingCapability, LoggingCapability, and the corresponding properties on ClientCapabilities / ServerCapabilities).
  • Method-name and notification-name constants in RequestMethods and NotificationMethods.
  • Convenience client/server methods, handlers, builders, and request filters tied to these features.
  • The sampling/roots helpers on the input request/response types.

Diagnostic ID

All three features share a single diagnostic ID, MCP9005, so consumers can opt out with one suppression. Feature-specific messages (Roots, Sampling, Logging) keep the diagnostics distinguishable in build output.

  • Documented the new diagnostic in docs/list-of-diagnostics.md.
  • Suppressed MCP9005 internally where the SDK, tests, and samples still exercise the deprecated APIs.

Validation

  • dotnet build -c Release: succeeds with 0 warnings (TreatWarningsAsErrors=true).
  • dotnet test -c Release: all tests pass.

Mark all public API surface for the Roots, Sampling, and Logging features as
[Obsolete] in line with SEP-2577. This covers protocol DTOs, capability
properties, method-name constants, convenience methods, handlers, builders,
filters, and the related sampling/roots helpers on the input request/response
types. There is no functional or wire behavior change; the features continue to
work exactly as before.

All three features share a single diagnostic ID (MCP9005) so consumers can opt
out with one suppression, while feature-specific messages keep the diagnostics
distinguishable. Documents the new diagnostic in docs/list-of-diagnostics.md and
suppresses MCP9005 where the SDK, tests, and samples exercise the deprecated
APIs internally.
Comment on lines +5 to +6
<!-- Suppress the Roots, Sampling, and Logging obsoletion warning (SEP-2577) in sample projects
that demonstrate the deprecated features, which continue to work. -->

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there other projects besides the logging sample project that require this? Ideally out samples shouldn't use deprecated features unless they're specifically samples for that feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants